<template>
  <div>
    <el-menu
      :default-active="activeIndex2"
      class="el-menu-demo"
      mode="horizontal"
      @select="handleSelect"
      background-color="#545c64"
      text-color="#fff"
      active-text-color="#ffd04b"
    >
      <el-menu-item index="1">CodingLife</el-menu-item>
      <el-menu-item index="2">首页</el-menu-item>
      <el-menu-item index="3">
        <el-input placeholder="请输入关键词" v-model="input2">
          <el-button slot="append" icon="el-icon-search"></el-button>
        </el-input>
      </el-menu-item>
      <el-menu-item index="4" style="float:right">登录</el-menu-item>
      <el-menu-item index="5" style="float:right">注册</el-menu-item>
    </el-menu>
  </div>
</template>

<style lang="scss">
</style>

<script>
export default {
  data() {
    return {
      activeIndex: "1",
      activeIndex2: "1"
    };
  },
  methods: {
    handleSelect(key, keyPath) {
      console.log(key, keyPath);
    }
  }
};
</script>